<?php

namespace slinks\extensions\action\configuration;

use slinks\core\HttpFoundation\IRequest;
use slinks\extensions\action\configuration\IActionMapping;
use slinks\extensions\action\configuration\IResultMapping;
use slinks\extensions\action\core\IActionContext;

/**
 * Responsible for locating Actions
 * 
 * @author Navid Mitchell
 *
 */
interface IConfiguration {

    /**
     * Find the Action Mapping for a given request
     *
     * @param string $actionMappingName the name of the IActionMapping.
     * @return IActionMapping the action mapping for this request.
     */
    public function findActionMapping($actionMappingName);

    /**
     * @return array of all configured IActionMappings keyed by the IActionMapping->getName().
     */
    public function getAllActionMappings();
    
    /**
     * Find a IActionInvocation for the Action mapping.
     *
     * @param IActionContext $actionContext for the current request.
     * @return IActionInvocation
     */
    public function findActionInvocation(IActionContext $actionContext);

    /**
     * Find the IResult implementation for the given IResultMapping.
     * 
     * @param IResultMapping $resultMapping
     */
    public function findResult(IResultMapping $resultMapping);
}